Copilot/server protocols naming and navigation#9
Open
Pmaster-dev wants to merge 8 commits into
Open
Conversation
…rator variables (#1) Adds `src/automation/` — a pure-Python, event-driven automation subsystem with no runtime dependencies beyond stdlib. ## Variables (`variables.py`) - **`GeneratorVariable`**: lazy value production via generator factory; idempotent `peek()`, `reset()`, and composition via `.map()` / `.filter()` / `.take()` / `.chain()` - **`VariableRegistry`**: named lookup store shared across automation steps ## Components (`components.py`) - **`Component`** (ABC): `execute(input_) → ComponentOutput` contract with optional `validate` / `setup` / `teardown` hooks - **`FunctionComponent`**: wraps any callable as a component without subclassing - **`ComponentRegistry`**: name-based registration, `run()` with pre-execution validation, `run_pipeline()` for sequential chaining ## Engine (`engine.py`) - **`AutomationEngine`**: purely call-driven (no threads, no listener) — safe for FaaS environments - `AutomationDefinition` binds trigger event types → component pipeline + variable references - Variables are **peeked** into run metadata (not consumed), keeping runs reproducible - Before/after middleware hooks; hook exceptions are logged, not swallowed - `stats()` / `history()` for observability ```python engine = AutomationEngine() engine.register_fn("upper", lambda inp: inp.payload.upper()) engine.define_variable("seq", lambda: (f"id-{i}" for i in range(100))) engine.define(AutomationDefinition( name="shout", triggers=["msg.received"], steps=["upper"], variables=["seq"] )) results = engine.trigger_type("msg.received", payload="hello") # results[0].status == RunStatus.SUCCESS # results[0].outputs[-1].result == "HELLO" ``` --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: Pmaster-dev <[email protected]> Co-authored-by: Copilot Autofix powered by AI <[email protected]>
…in CI (#2) The Pyre workflow was failing before analysis started because `facebook/pyre-action` transitively depended on deprecated `actions/upload-artifact@v2`, which GitHub now blocks. This change removes that dependency path and runs Pyre directly in the workflow. - **Workflow dependency path cleanup** - Removed `facebook/pyre-action@60697a7858f7cc8470d8cc494a3cf2ad6b06560d` from `.github/workflows/pyre.yml`. - Kept job trigger and permissions model intact. - **Direct Pyre setup/execution** - Added `actions/setup-python@v5` with Python `3.11`. - Added shell-based dependency installation (`pip`, optional `requirements.txt`, `pyre-check`). - Replaced action invocation with `pyre check`. - **Resulting CI behavior** - Pyre now runs via first-party setup + explicit commands, avoiding blocked transitive actions and keeping the check logic in-repo and transparent. ```yaml - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.11' - name: Install dependencies run: | python -m pip install --upgrade pip if [ -f requirements.txt ]; then pip install -r requirements.txt fi pip install pyre-check - name: Run Pyre run: pyre check ``` --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: Pmaster-dev <[email protected]> Co-authored-by: Copilot Autofix powered by AI <[email protected]>
…act (#3) This PR implements the first phase of the ecosystem alignment plan by documenting the `pinkycollie` + `Pmaster-dev` operating model and introducing a reusable API contract for automation workflows. It establishes a concrete source of truth in `server` for cross-org orchestration and contract-driven integration. - **Ecosystem inventory (cross-org map)** - Added `docs/pinkycollie-ecosystem-inventory.md` with the six-layer strategy: - org-level template hubs - standardized CI/CD lifecycle - framework/repo instance mapping - REST vs webhook decision rules - webhook bridge flow - versioned artifact locations - Captures ordered next actions to drive rollout across repos. - **Shared automation API contract** - Added `docs/openapi/automation.yaml` (OpenAPI 3.1) defining core automation endpoints: - trigger events - manage automation definitions - inspect run history and aggregate stats - Includes typed schemas for definitions, run results, status enums, and stats to support consistent producer/consumer integration across repos. - **Contract clarity improvements** - Set environment-neutral server base URL (`/`) for deployment-specific resolution. - Tightened schema documentation for payload semantics and step/variable identifier fields. ```yaml paths: /automation/events/trigger: post: operationId: triggerAutomationEvent requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/TriggerEventRequest' ``` --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: Pmaster-dev <[email protected]> Co-authored-by: Copilot Autofix powered by AI <[email protected]>
) Repo had no dependency manifest, no gitignore, a stray image/PHP file, empty placeholder dirs, and no documentation surface. Restructures into a clean, deployable state with published docs. ## Removed - `com.phlox.simpleserver_73.png`, `domnornalizer.php` — untracked stray files - `spec/`, `types/` — empty placeholder trees with no content ## Added - **`.gitignore`** — Python (`__pycache__`, `.pyre/`, `.venv/`), PHP, OS, Jekyll build artifacts - **`requirements.txt`** — pinned deps derived from `auth/utils.py` (`bcrypt`, `PyJWT`, `Flask`, `flask-jwt-extended`, `redis`) - **`docs/`** — Jekyll source for GitHub Pages (Cayman theme): - `index.md` — module inventory landing page - `guides/getting-started.md` — install, engine usage, auth utils, env vars - `api/automation.md` — full HTTP API reference mirroring the OpenAPI spec - `_config.yml` — Jekyll/Pages config - **`.github/workflows/ci.yml`** — pylint + pytest on push/PR to `develop`/`main` - **`.github/workflows/pages.yml`** — Jekyll build + `deploy-pages` on push to `main` ## Updated - **`README.md`** — CI/Pages badges, repo layout table, quick-start, env var notes ## Activation After merge: **Settings → Pages → Source → GitHub Actions**. --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]>
This PR captures the behaviors called out in review thread `4595682762` with focused regression tests, so the reviewed fixes remain enforced across the automation package. The coverage targets the generator variable, component registry, engine failure path, and package quick-start import example. - **Generator variable drain semantics** - Adds coverage for the `peek()` + `collect()` interaction to ensure a peeked value is preserved when draining the remaining sequence. - **Component lifecycle and failure reporting** - Verifies component replacement triggers teardown on the previously registered instance. - Verifies `FunctionComponent` surfaces traceback text when wrapped callables fail. - **Automation engine variable handling** - Verifies missing declared variables fail the run instead of being silently omitted from the metadata snapshot. - **Package quick-start contract** - Verifies the package docstring examples use `automation` imports rather than a non-package `src.automation` path. ```python variable = GeneratorVariable.from_iterable([1, 2, 3]) assert variable.peek() == 1 assert variable.collect() == [1, 2, 3] ``` --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pre-requisites
Please note that at this time we are only accepting new starter workflows for Code Scanning. Updates to existing starter workflows are fine.
Tasks
For all workflows, the workflow:
.ymlfile with the language or platform as its filename, in lower, kebab-cased format (for example,docker-image.yml). Special characters should be removed or replaced with words as appropriate (for example, "dotnet" instead of ".NET").GITHUB_TOKENso that the workflow runs successfully.For CI workflows, the workflow:
cidirectory.ci/properties/*.properties.jsonfile (for example,ci/properties/docker-publish.properties.json).pushtobranches: [ $default-branch ]andpull_requesttobranches: [ $default-branch ].releasewithtypes: [ created ].docker-publish.yml).For Code Scanning workflows, the workflow:
code-scanningdirectory.code-scanning/properties/*.properties.jsonfile (for example,code-scanning/properties/codeql.properties.json), with properties set as follows:name: Name of the Code Scanning integration.creator: Name of the organization/user producing the Code Scanning integration.description: Short description of the Code Scanning integration.categories: Array of languages supported by the Code Scanning integration.iconName: Name of the SVG logo representing the Code Scanning integration. This SVG logo must be present in theiconsdirectory.pushtobranches: [ $default-branch, $protected-branches ]andpull_requesttobranches: [ $default-branch ]. We also recommend ascheduletrigger ofcron: $cron-weekly(for example,codeql.yml).Some general notes:
actionsorganization, or